﻿using System.Web.UI;
using Core.AdminMenu;
using Core.AdminUser;
using Core.Library;

namespace Core.Authenticated
{
    public class AuthenticatedControl : UserControl, ITemplate
    {
        public int Status { get; set; }
       
        public AdminUserObject CurrentUser
        {
            get
            {
                return ((AuthenticatedPage)this.Page).CurrentUser;
            }
        }

        public int cId
        {
            get
            {
                return ConvertUtility.ToInt32(Request.QueryString["cId"]);
            }
        }

        public AdminMenuObject cControl
        {
            get
            {
                return AdminMenuController.AdminMenu_GetById(ConvertUtility.ToInt32(Request.QueryString["cId"]));
            }
        }

        public void InstantiateIn(Control container)
        {
            container.Controls.Add(this);
        }
    }
}
